<script setup>
// 接收父组件传递的数据
let parent = defineProps({
  'title': {type: String, required: true},
  'fn': {type: Function, required: false},
  'size': {type: String, required: false, default: 'small'},
  'label': {type: String, required: false, default: '确认操作吗？'},
  'type': {type: String, required: false, default: 'danger'},
  'plain': {type: Boolean, required: false, default: true},
});
</script>

<template>
  <el-popconfirm class="my-confirm" :title="title" @confirm="fn">
    <template #reference>
      <el-button :type="type" :plain="plain" :size="size">
        {{ label }}
      </el-button>
    </template>
  </el-popconfirm>
</template>

<style scoped lang="scss">

</style>